package com.cqw.classtest;

/**
 * @Author: caoqingwen
 * @CreateTime: 2022-03-11 15:18
 * @Description:
 */
public class StringClass {


    public static void main(String[] args) {

        String s = new String();
//        System.out.println(s);

        byte[] bytes = {1, 2, 3};
        String s1 = new String(bytes);
//        System.out.println(s1);

        String s2 = new String(bytes, 1, 2);
//        System.out.println(s2);

        char[] chars = {'1', '2', '3'};
        String s3 = new String(chars);
//        System.out.println(s3);

        String s4 = new String(chars, 1, 2);
//        System.out.println(s4);

        String s5 = "曹青稳";
//        System.out.println(s5.length());

        String substring = s5.substring(1);
//        System.out.println(s5);
//        System.out.println(substring);

        String substring1 = s5.substring(0, 3);
//        System.out.println(substring1);

        boolean startsWith = s5.startsWith("曹");
//        System.out.println(startsWith);

        boolean startsWith1 = s5.startsWith("曹青");
//        System.out.println(startsWith1);

        boolean endsWith = s5.endsWith("曹");
//        System.out.println(endsWith);

        boolean contains = s5.contains("曹");
//        System.out.println(contains);

        boolean contains1 = s5.contains("曹庆");
//        System.out.println(contains1);

        int indexOf = s5.indexOf("曹");
//        System.out.println(indexOf);

        int i = s5.indexOf(2);
//        System.out.println(i);

        byte[] bytes1 = s5.getBytes();
//        System.out.println(bytes1);

        char[] chars1 = s5.toCharArray();
        for (char c : chars1) {
//            System.out.println(c);
        }

        boolean b = "cao".equalsIgnoreCase(s5);
//        System.out.println(b);

        char c = s5.charAt(2);
//        System.out.println(c);


        int lastIndexOf = s5.lastIndexOf("曹");
//        System.out.println(lastIndexOf);

        String toUpperCase = s5.toUpperCase();
//        System.out.println(toUpperCase);

        String toLowerCase = s5.toLowerCase();
//        System.out.println(toLowerCase);

        String[] split = s5.split("青");
        for (String s6 : split) {
//            System.out.println(s6);
        }

        String s6 = "boo:and:foo";
        String[] split1 = s6.split(":");
//        System.out.println(Arrays.toString(split1));

        String[] split2 = s6.split("o");
//        System.out.println(Arrays.toString(split2));

        String s7 = "    cao qing wen   ";
//        System.out.println(s7.trim());

        String replace = s7.replace(" ", "");
//        System.out.println(replace);

        String replaceAll = s7.replaceAll(" ", "");
//        System.out.println(replaceAll);








    }


}
